home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_10_10 / 1010024b < prev    next >
Encoding:
Text File  |  1992-08-31  |  294 b   |  17 lines

  1. #include <stdio.h>
  2.  
  3. #define MAXLINE 80
  4.  
  5. main()
  6. {
  7.     int n;
  8.     char c, buf[MAXLINE+1];
  9.     
  10.     while (gets(buf))
  11.         if (sscanf(buf,"%d , %c",&n, &c) == 2)
  12.             printf("%d, %c\n",n,c);
  13.         else
  14.             printf("Invalid input: \"%s\"\n",buf);
  15.     return 0;
  16. }
  17.